<?
$media=$model;

if($model->id==0){
		$hidden['category_id']=$this->input->get('parent_id');
		$category_id=$this->input->get('parent_id');
}else{
	$category_id=$media->category_id;
}

$catlist=ORM::factory('category')->get_pulldown_list();
$hidden['formtype']='detail';


?>
<div class='contentheader'>Ein neues Mediaelement erstellen</div>

<?
if($model->id!=0){
	echo $formheader;
}

echo form::open_multipart(NULL, array(), $hidden );
echo form::hidden('id', $media->id);
echo form::open_fieldset();


echo myform::dropdown('var1','Var1',$media->varsarray, $media->var1);

if($media->type=='image'){
	echo myform::imgelm('Image', $media->id);
}else{
	echo myform::textelm("Datei",$media->url);
}

echo form::close_fieldset();
echo myform::submit();
echo form::close();
?>